FROM centos:7

LABEL author="lishuoboy"
LABEL msg="基于centos7，设置时区、字符集，安装ip、java"

# 1.1.2. 环境配置＆安装软件

# 1.1.2.1.环境配置

# 1.1.2.1.1.配置时区

# 参考：<https://blog.csdn.net/lishuoboy/article/details/131147829>

RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

# 1.1.2.1.2.配置中文、字符编码

# 参考：<https://blog.csdn.net/lishuoboy/article/details/131146521>

# 1.1.2.2 yum安装软件（不推荐，减小容器占用空间）

# 1、ip

# 可用centos7内内置`hostname -i`命令

RUN yum -y install initscripts

# 2、ifconfig

#　可用centos7内内置`hostname -i`命令

#RUN yum install -y net-tools.x86_64

# 3、wget

# 可用centos7内置`curl`命令

# RUN yum install -y wget

# 4、telnet

# 可用centos7内置`curl`命令测端口连通性

# 如有问题参考<https://blog.csdn.net/lianghecai52171314/article/details/104870444>

#RUN yum -y install telnet.x86_64

# 5、vim

# 可用centos7内置vi命令

#RUN yum install -y vim

# 6、sz/rz

#RUN yum install -y lrzsz

# 7、netstat

#RUN yum install -y net-tools

# 8、unzip

#RUN yum install -y unzip

# 9、killall

#RUN yum install -y psmisc

# 10、lsof

# 是一个列出当前系统打开文件的工具

#RUN yum install -y lsof

# 11、ssh

#RUN yum install sshd

# 12、rpmbuild

#RUN yum install -y rpm-build

# 13、pip

# python的命令，类似于linux系统里的yum命令

#RUN yum install -y python-pip

# 1.1.2.3.`rpm`安装`OracleJDK 17`

# 打开OracleJDK官网：<https://www.oracle.com/java/technologies/downloads>

#下载jdk17到宿主机某个目录，然后`ADD/COPY`进容器。或者直接在容器中`wget`命令下载(需在容器中安装wget命令)

# 下载或复制到容器
#ADD ./jdk-17_linux-x64_bin.rpm /root
RUN curl https://download.oracle.com/java/17/latest/jdk-17_linux-x64_bin.rpm -o ~/jdk-17_linux-x64_bin.rpm

# 安装
RUN yum localinstall -y ~/jdk-17_linux-x64_bin.rpm

#或
# RUN rpm -ivh /root/jdk-17_linux-x64_bin.rpm

# 删除安装包
RUN rm -rf ~/jdk-17_linux-x64_bin.rpm

